import sys
from PyQt5.Qt import QApplication, QIcon
from index import IndexWin
from page import PageWin
from utils.new_window import NewWindow
from config import Cfg

import images_qrc


def run():
    print('running...')

    app = QApplication(sys.argv)
    win = NewWindow()
    win.setWindowIcon(QIcon(':images/logo.png'))

    index_win = IndexWin()
    index_win.setWindowIcon(QIcon(':images/logo.png'))

    page_win = PageWin()
    page_win.setWindowIcon(QIcon(':images/logo.png'))

    index_win.setup_ui(win)
    win.show()

    Cfg.dic['__indexwin__'] = win
    Cfg.dic['__pagewin__'] = page_win

    sys.exit(app.exec_())


if __name__ == '__main__':
    run()
